<!DOCTYPE html>
<html lang="en"   xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../static/css/creatorCenter.css" th:href="@{/css/creatorCenter.css}">
    <link rel="stylesheet" href="../static/css/iconfont.css" th:href="@{/css/iconfont.css}">
    <link rel="stylesheet" href="../static/css/common.css" th:href="@{/css/common.css}">
    <link rel="stylesheet" href="../static/css/personCenter.css" th:href="@{/css/personCenter.css}">
    <link rel="stylesheet" href="../static/css/creatorCenterContent.css" th:href="@{/css/creatorCenterContent.css}">
    <title>导航栏示例</title>
</head>

<body>
<div class="main">
    <div class="nav-container" th:replace="creatorCenterAccount::Tap">
</div>
<div class="right">
    <div class="blockB">
        <div class="tap">
            <ul>
                <li class="active"><a class="tap-a" href="/userHomepage" th:href="@{/userHomepage}">文章&nbsp;&nbsp;</a></li>
                <li><a href="/userHomepage/videos" class="tap-a" th:href="@{/userHomepage/videos}" >视频&nbsp;&nbsp;  </a></li>
                <li><a href="/userHomepage/views" class="tap-a" th:href="@{/userHomepage/views}" >想法&nbsp;&nbsp;  </a></li>
                <li><a href="/userHomepage/likes" class="tap-a" th:href="@{/userHomepage/likes}" >喜欢&nbsp;&nbsp; </a></li>
                <li> <a href="/userHomepage/follower" class="tap-a" th:href="@{/userHomepage/follower}" >关注订阅&nbsp; </a></li></ul>
        </div>
        <div class="article" style="display: block;" >
            <div class="mydongtai">我的文章</div>
            <div class="box-a" style="display: none;"><i class="shu iconfont">&#xe617;</i>
                <div class="box-a1"> <a class="kong" href=""  style="margin-left: 59px;">还没有文章</a></div></div>
            <div class="question-container" style="display: block;"  th:each="post, postStat : ${posts}" >
                <div class="top-story-main-column" style="width: 100%;">
                    <div class="top-story-content-detail" style="margin-left: -19px;" th:data-value="${post.id}">
                        <a  th:href="@{/posts/selectMe/id?id={id}(id=${post.id})}" style="color: black">
                            <div class="top-story-content-head" ><h3 th:text="${post.title}"></h3></div> </a>
                        <div class="postcontent" >
                            <div class="top-story-content-detail-list" >
                                <p class="top-story-content-detail-list-p">
                                    <a  th:href="@{/posts/selectMe/id?id={id}(id=${post.id})}" style="color: black">
                                   <span class="user-information">
                                        <img src="../static/img/OIP-C.jpg" alt="" th:src="${user.avatar}" style="width: 43px;height: 43px">
                                        <span th:text="${user.username}" style="display: block;margin-top: -36px;margin-left: 68px;"></span>
                                        <i class="word-introduction" th:text="${user.bio}" style="display: block;margin-left: 64px;">&nbsp;&nbsp;</i>
                                    </span>

                                        <i class="user-name" th:if="${userStat.index == postStat.index}"  th:each="user, userStat : ${user}"></i>
                                        <i class="empty" th:text="${post.content}"> &nbsp;&nbsp;&nbsp;&nbsp;  </i></a>
                                </p>
                                <span class="read-full-text"><i class="iconfont">&#xe60d;</i>阅读全文<i class="iconfont">&#xe7d1;</i></span>
                            </div>
                            <div class="content-right">
                                <img  alt="" th:src="${post.imageUrl}"  th:if="${not #strings.isEmpty(post.imageUrl)}"  class="img-content">

                            </div>
                        </div>

                        <div class="top-story-content-footer" >

                            <button class="top-story-content-footer-button top-story-content-footer-button-start"  th:value="${post.commentCount}" th:data-value="${post.id}" onclick="articleDetail(this.dataset.value)"><i class="iconfont comment" >&#xe619;</i><span th:text="${post.commentCount}"></span>条评论</button>

                            <button class="top-story-content-footer-button top-story-content-footer-button-share"><i class="iconfont share" >&#xe60e;</i>分享</button>

                            <button class="top-story-content-footer-button top-story-content-footer-button-like"  th:value="${post.id}"  ><i class="iconfont like" >&#xe610;</i><span th:text="${post.likeCount}"></span>喜欢</button>
                            <button class="top-story-content-footer-button top-story-content-footer-button-view"  th:value="${post.id}"  ><span th:text="${post.viewCount}"></span>浏览</button>
                            <button class="top-story-content-footer-button top-story-content-footer-button-more delete-article"  th:if="${post.userId == session.userId}"   th:data-post-id="${post.id}">
                                <i class="iconfont more">&#xe63f;</i>
                                删除
                            </button>
                            <div class="share-outer">
                                <div class="share-detail">
                                    <i class="iconfont">&#xe618;</i>
                                    <span>复制链接</span>
                                </div>
                            </div>
                        </div>
                        <div class="comment-publish">
                            <div class="comment-input-outer">
                                <div class="comment-input">
                                    <input type="text" placeholder="留下你的精彩评论吧"  class="comment-input-detail">
                                    <div class="input-icons">
                                        <i class="iconfont">&#xe642; </i>
                                        <span class="emoji-icon" th:data-value="${post.id}" onclick="publish(this.dataset.value)"> 发布</span>

                                    </div>
                                </div>
                            </div>
                            <div class="comment-item-outer">

                            </div>


                        </div>
                    </div>


                </div>   </div></div>

    </div>
<!--    <div class="article" style="display: block;" th:replace="creatCenterArticle::article"></div>-->
</div>
</div>
<div class="mask"></div>
<script th:inline="javascript">

    document.addEventListener('DOMContentLoaded', function() {
        const pathname = window.location.pathname;
        let temp = 0;
        if (pathname === '/mainPageRecommend') {
            temp = 1

            document.getElementsByClassName('none-input')[0].value = temp
        } else if (pathname === '/mainPageAttention') {
            temp = 2
            document.getElementsByClassName('none-input')[0].value = temp
        } else if (pathname === '/mainPageTrending') {
            temp = 3
            document.getElementsByClassName('none-input')[0].value = temp
        }else if (pathname === '/creativeCenter') {
            temp=4
            document.getElementsByClassName('none-input')[0].value = temp
        }else if (pathname === '/toManageMyPosts') {
            temp=5
            document.getElementsByClassName('none-input')[0].value = temp
        }
        let result = [[${result}]];
        let errorMessage = [[${errorMessage}]];
        console.log(result)
        if (result && result !== '') {
            showCustomAlert(result, 3000);
        }
        if (errorMessage && errorMessage !== '') {
            showCustomAlert(errorMessage, 3000);
        }
    })

</script>
<script src="../static/js/creatorCenterContent.js" th:src="@{/js/creatorCenterContent.js}"></script>
<script src="../static/js/personCenter.js" th:src="@{/js/personCenter.js}"></script>
<script src="../static/js/common.js" th:src="@{/js/common.js}"></script>
</body>

</html>